package com.pearadmin.pro.modules.stu.service.impl;

import java.util.List;
import java.util.ArrayList;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pearadmin.pro.common.web.base.page.PageResponse;
import com.pearadmin.pro.common.web.base.page.Pageable;

import com.pearadmin.pro.modules.stu.domain.StuPrePolicy;
import com.pearadmin.pro.modules.stu.param.StuPrePolicyRequest;
import com.pearadmin.pro.modules.stu.repository.StuPrePolicyRepository;
import com.pearadmin.pro.modules.stu.service.StuPrePolicyService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;


/**
 * 签单优惠政策Service业务层处理
 *
 * @author chenJian
 * @date 2021-09-09
 */
@Service
public class StuPrePolicyServiceImpl extends ServiceImpl<StuPrePolicyRepository, StuPrePolicy> implements StuPrePolicyService
{
    @Resource
    private StuPrePolicyRepository stuPrePolicyRepository;

    /**
     * 查询签单优惠政策
     * @param request
     * @return 签单优惠政策 分页集合
     * */
    @Override
    public PageResponse<StuPrePolicy> page(StuPrePolicyRequest request)
    {
        LambdaQueryWrapper<StuPrePolicy> query = new LambdaQueryWrapper<StuPrePolicy>();
        return Pageable.of(request,(()->  stuPrePolicyRepository.selectList(query)));
    }

    /**
     * 查询签单优惠政策
     *
     * @param id 签单优惠政策ID
     * @return 签单优惠政策
     */
    @Override
    public StuPrePolicy selectStuPrePolicyById(Long id)
    {
        return stuPrePolicyRepository.selectById(id);
    }

}
